package leafedbox.commands
{
	import mx.rpc.http.HTTPService;
	import mx.rpc.events.ResultEvent;

	/**
	 * This class represents a command that uses XML as a transfer medium
	 * via an HTTP Service.
	 */
	public class XmlHttpRemoteCommand extends HttpRemoteCommand
	{

		//--------------------------------------------------------------------------
		// Constructor
		//--------------------------------------------------------------------------
	
		/**
		 * Constructor.
		 */
		public function XmlHttpRemoteCommand():void
		{
			super();
			service.resultFormat = HTTPService.RESULT_FORMAT_E4X;
		}


		//--------------------------------------------------------------------------
		// Properties
		//--------------------------------------------------------------------------
	
		/**
		 * The XML returned from the service.
		 */
		public var xml : XML;
		
		
		//--------------------------------------------------------------------------
		// Methods : RemoteCommand
		//--------------------------------------------------------------------------
	
		/**
		 * Reponds to a result event from the service.
		 */
		override protected function service_onResult(event:ResultEvent):void
		{
			xml = event.result as XML;
			super.service_onResult(event);
		}


	}

}